<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head th:include="include :: header"></head>
<style>
    #photo {
        max-width: 100%;
        max-height: 350px;
    }
</style>
<body class="hold-transition skin-blue sidebar-mini">
<!--修改密码-->
<div class="modal fade" data-backdrop="static" data-keyboard="false" id="modal-updatePassword">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">修改密码</h4>
            </div>
            <div class="modal-body">
                <form id="userForm" class="form-horizontal" role="form">
                    <div class="form-group">
                        <label for="pwd" class="col-sm-2 control-label no-padding-right">新的密码</label>
                        <div class="col-sm-10">
                            <input type="password" class="form-control" id="pwd" name="pwd"
                                   placeholder="请输入新密码">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="rePwd" class="col-sm-2 control-label no-padding-right">重复密码</label>
                        <div class="col-sm-10">
                            <input type="password" class="form-control" id="rePwd" name="rePwd"
                                   placeholder="请再输入一次">
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-info" id="btn-updatePassword">确定</button>
            </div>
        </div>
    </div>
</div>
<!--修改头像-->
<div class="modal fade" data-backdrop="static" data-keyboard="false" id="modal-upload">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">修改头像</h4>
            </div>
            <div class="modal-body">
                <p class="tip-info text-center">
                    未选择图片
                </p>
                <div class="img-container hidden">
                    <img src="" alt="" id="photo">
                </div>
                <div class="img-preview-box hidden">
                    <hr>
                    <span>150*150:</span>
                    <div class="img-preview img-preview-lg">
                    </div>
                    <span>100*100:</span>
                    <div class="img-preview img-preview-md">
                    </div>
                    <span>30*30:</span>
                    <div class="img-preview img-preview-sm">
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <label class="btn btn-danger pull-left" for="photoInput">
                    <input type="file" class="sr-only" id="photoInput" accept="image/*">
                    <span>打开图片</span>
                </label>
                <button type="button" class="btn btn-info disabled" disabled id="btn-upload" onclick="sendPhoto()">确定
                </button>
                <p style="color:red;margin-top: 8px;margin-left: 20px" class="pull-left">比例 1 ：1 建议尺寸 300 x 300</p>
            </div>
        </div>
    </div>
</div>

<div class="wrapper">

    <header class="main-header">
        <a class="logo">
            <span class="logo-lg"><b style="float:left">技术文件管理系统</b></span>
        </a>
        <nav class="navbar navbar-static-top">
            <a href="#" class="sidebar-toggle" data-toggle="push-menu" title="菜单缩放" role="button"></a>
            <div class="navbar-custom-menu">
                <ul class="nav navbar-nav">
                    <!--<li class="dropdown messages-menu">
                        <a href="#" title="项目下达任务消息提示" class="dropdown-toggle" data-toggle="dropdown">
                            <i class="fa fa-comment-o"></i>
                            <span class="label label-danger" id="count-send"></span>
                        </a>
                        <ul class="dropdown-menu">
                            <li>
                                <ul class="menu" id="unread-send"></ul>
                            </li>
                            <li class="footer" id="no-send"><a href="javascript:void(0)">没有未读消息</a></li>
                        </ul>
                    </li>
                    <li class="dropdown messages-menu">
                        <a href="#" title="项目变更消息提示" class="dropdown-toggle" data-toggle="dropdown">
                            <i class="fa fa-bell-o"></i>
                            <span class="label label-danger" id="count-change"></span>
                        </a>
                        <ul class="dropdown-menu">
                            <li>
                                <ul class="menu" id="unread-change"></ul>
                            </li>
                            <li class="footer" id="no-change"><a href="javascript:void(0)">没有未读消息</a></li>
                        </ul>
                    </li>
                    <li class="dropdown messages-menu">
                        <a href="#" title="互动专区消息提示" class="dropdown-toggle" data-toggle="dropdown">
                            <i class="fa fa-envelope-o"></i>
                            <span class="label label-danger" id="count-interactive"></span>
                        </a>
                        <ul class="dropdown-menu">
                            <li>
                                <ul class="menu" id="unread-interactive"></ul>
                            </li>
                            <li class="footer" id="no-interactive"><a href="javascript:void(0)">没有未读消息</a></li>
                        </ul>
                    </li>-->
                    <li shiro:authenticated="true" class="dropdown user user-menu" style="width: 160px!important;">
                        <a href="#" id="account" class="dropdown-toggle" data-toggle="dropdown">
                            <img th:src="${#strings.isEmpty(session.user.avatar)}?@{/img/person.png}:${session.user.avatar}"
                                 id="userImage" class="user-image img-circle"/>
                            <span class="hidden-xs" th:text="${session.user.name}"></span>
                        </a>
                        <ul class="dropdown-menu"
                            style="margin:0!important;width: 100px!important;padding: 0!important;">
                            <!--<li style="width: 90px!important;" id="updateSign"><a style="padding: 0px" href="javascript:void(0)" class="pull-right" onclick="js.modal.open('modal-updatePassword')"><i class="fa fa-edit">&nbsp;修改头像</i></a></li>-->
                            <!--<li style="width: 90px!important;" id="updatePwd"><a style="padding: 0px"  href="javascript:void(0)" class="pull-right" onclick="js.modal.open('modal-upload')"><i class="fa fa-edit">&nbsp;修改签名</i></a></li>-->
                        </ul>
                    </li>
                    <li shiro:authenticated="true">
                        <a href="#" id="updatePassword" onclick="js.modal.open('modal-updatePassword')">
                            <i class="fa fa-edit">&nbsp;修改密码</i>
                        </a>
                    </li>
                    <li><a th:href="@{/file/技术文件管理系统操作手册V1.0.docx}">帮助文档</a></li>
                    <li>
                        <a th:href="@{/logout}">
                            <i class="fa fa-sign-out">&nbsp;退出</i>
                        </a>
                    </li>
                </ul>
            </div>
        </nav>
    </header>

    <aside class="main-sidebar">
        <section class="sidebar">
            <ul class="sidebar-menu" data-widget="tree">
                <!--系统总览-->
                <li shiro:hasPermission="overview:menu" class="treeview menu-open">
                    <a href="#">
                        <i class="fa fa-folder-open text-maroon"></i>
                        <span>系统总览</span>
                        <span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
                    </a>
                    <ul class="treeview-menu" style="display: block;">
                        <li class="active">
                            <a th:href="@{/overview/home}" shiro:hasPermission="overview:home:view" target="content">
                                <i class="fa fa-home text-orange"></i> 首页
                            </a>
                        </li>
                        <li class="active">
                            <a th:href="@{/projectChange/chgInfo}" shiro:hasPermission="projectChange:home:view" target="content">
                                <i class="fa fa-paper-plane-o text-teal"></i>变更通知
                            </a>
                        </li>
                    </ul>
                </li>
                <!--设计任务管理-->
                <li shiro:hasPermission="design:menu" class="treeview">
                    <a href="#">
                        <i class="fa fa-folder-open  text-primary"></i>
                        <span>设计任务管理</span>
                        <span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
                    </a>
                    <ul class="treeview-menu">
                        <li>
                            <a th:href="@{/designTask/add/task}" shiro:hasPermission="dsn:task:view" target="content">
                                <i class="fa fa-clone text-green"></i> 设计任务下达
                                <span class="pull-right-container">
                                    <small id="issueTaskCount" class="label pull-right bg-green"
                                           th:text="${issueTaskCount > 0 ? issueTaskCount : ''}">12</small>
                                </span>
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/designTask/taskChange/changePage}" shiro:hasPermission="dsn:taskCha:view" target="content">
                                <i class="fa fa-window-restore text-green"></i> 设计科室变更
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/designTask/proStruct/createProList}" shiro:hasPermission="dsn:proCreate:view"
                               target="content">
                                <i class="fa fa-file-text text-blue"></i> 产品结构创建
                                <span class="pull-right-container">
                                    <small id="saveProCount" class="label pull-right bg-blue"
                                           th:text="${saveProCount > 0 ? saveProCount : ''}">12</small>
                                </span>
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/designTask/proStruct/checkProList}" shiro:hasPermission="dsn:proCheck:view"
                               target="content">
                                <i class="fa fa-check-square-o text-blue"></i> 产品结构审核
                                <span class="pull-right-container">
                                    <small id="checkProCount" class="label pull-right bg-red"
                                           th:text="${checkProCount > 0 ? checkProCount : ''}">12</small>
                                </span>
                            </a>
                        </li>
                        <!--<li>
                            <a th:href="@{/designTask/dsnIssue/page}" shiro:hasPermission="dsn:proIssue:view"
                               target="content">
                                <i class="fa fa-link  text-orange"></i> 图纸下发确认
                            </a>
                        </li>-->
                        <li>
                            <a th:href="@{/designTask/process/processPage}" shiro:hasPermission="dsn:proBull:view"
                               target="content">
                                <i class="fa fa-map  text-lime"></i> 设计进度看板
                            </a>
                        </li>
                        <!--<li>
                            <a th:href="@{/designTask/gant/createPage}" shiro:hasPermission="dsn:proTasks:view"
                               target="content">
                                <i class="fa fa-object-group  text-lime"></i> 任务项编辑
                            </a>
                        </li>-->
                        <li>
                            <a th:href="@{/designTask/gant/gantPage}" shiro:hasPermission="dsn:proTaskinfor:view"
                               target="content">
                                <i class="fa fa-object-group text-lime"></i> 任务项查询
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/designTask/query}" shiro:hasPermission="dsn:makeChange:view"
                               target="content">
                                <i class="fa fa-search text-lime"></i> 设计科室变更查询
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/designTask/gant/gantWorkPage}" shiro:hasPermission="dsn:employee:view"
                               target="content">
                                <i class="fa fa-binoculars text-aqua"></i> 员工业绩查询
                            </a>
                        </li>
                    </ul>
                </li>
                <!--工艺任务管理-->
                <li shiro:hasPermission="processTask:menu" class="treeview">
                    <a href="#">
                        <i class="fa fa-folder-open   text-maroon"></i>
                        <span>工艺任务管理</span>
                        <span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
                    </a>
                    <ul class="treeview-menu">
                        <li>
                            <a th:href="@{/craft/receive}" shiro:hasPermission="tec:proDetail:view" target="content">
                                <i class="fa fa-tags text-yellow"></i> 制作件清单接收
                                <span class="pull-right-container">
                                    <small id="releaseCount" class="label pull-right bg-yellow"
                                           th:text="${releaseCount > 0 ? releaseCount : ''}">12</small>
                                </span>
                            </a>
                        </li>
                        <!--<li>-->
                        <!--<a th:href="@{/craft/productionInput}" shiro:hasPermission="tec:proProduc:view" target="content">-->
                        <!--<i class="fa fa-ticket  text-danger"></i> 生产制作件清单创建-->
                        <!--</a>-->
                        <!--</li>-->
                        <li>
                            <a th:href="@{/craft/release}" shiro:hasPermission="tec:proTaskrel:view" target="content">
                                <i class="fa fa-clipboard  text-olive"></i> 工艺任务下达
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/craft/maintain}" shiro:hasPermission="tec:proDirectory:view"
                               target="content">
                                <i class="fa fa-link  text-orange"></i> 制作件清单维护
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/craft/proQuery}" shiro:hasPermission="tec:proGress:view" target="content">
                                <i class="fa fa-table text-olive"></i> 工艺进度看板
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/craft/ComprehensiveQuery}" shiro:hasPermission="tec:protaskQuery:view"
                               target="content">
                                <i class="fa fa-search  text-lime"></i> 任务项查询
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/craft/EmployeeQuery}" shiro:hasPermission="tec:employee:view"
                               target="content">
                                <i class="fa fa-binoculars text-aqua"></i> 员工业绩查询
                            </a>
                        </li>
                    </ul>
                </li>
                <!--工艺编制管理-->
                <li shiro:hasPermission="processEst:menu" class="treeview">
                    <a href="#">
                        <i class="fa fa-folder-open  text-olive"></i>
                        <span>工艺编制管理</span>
                        <span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
                    </a>
                    <ul class="treeview-menu">
                        <!--<li>-->
                            <!--<a th:href="@{/est/cha}" shiro:hasPermission="est:cha:view" target="content">-->
                                <!--<i class="fa fa-info-circle  text-red"></i> 变更提醒-->
                                <!--<span class="pull-right-container">-->
                                    <!--<small id="notCardChangCount" class="label pull-right bg-yellow"-->
                                           <!--th:text="${notCardChangCount > 0 ? notCardChangCount : ''}">12</small>-->
                                <!--</span>-->
                            <!--</a>-->
                        <!--</li>-->
                        <li>
                            <a th:href="@{/est/add}" shiro:hasPermission="est:add:view" target="content">
                                <i class="fa fa-plus-square  text-teal"></i> 创建工艺卡
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/est/copy}" shiro:hasPermission="est:copy:view" target="content">
                                <i class="fa fa-clipboard  text-olive"></i> 复用工艺卡
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/est/cardList}" shiro:hasPermission="est:cardList:view" target="content">
                                <i class="fa fa-upload  text-teal"></i> 工艺卡提交
                                <span class="pull-right-container">
                                    <small id="notCreateCodeOneCount" class="label pull-right bg-red"
                                           th:text="${notCreateCodeOneCount > 0 ? notCreateCodeOneCount : ''}">12</small>
                                </span>
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/est/verify}" shiro:hasPermission="est:verify:view" target="content">
                                <i class="fa fa-window-restore  text-teal"></i> 工艺卡校对
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/est/worktime}" shiro:hasPermission="est:worktime:view" target="content">
                                <i class="fa fa-eercast  text-orange"></i> 机加工时编制
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/est/check}" shiro:hasPermission="est:check:view" target="content">
                                <i class="fa fa-check-circle  text-green"></i> 工艺卡审核
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/est/route}" shiro:hasPermission="est:route:view" target="content">
                                <i class="fa fa-wpexplorer  text-green"></i> 工艺路线查询
                            </a>
                        </li>

                        <li>
                            <a th:href="@{/est/worktimequery}" shiro:hasPermission="est:durmach:view" target="content">
                                <i class="fa fa-camera  text-blue"></i> 机加工时查询
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/est/worktimequery/2}" shiro:hasPermission="est:durmach:view" target="content">
                                <i class="fa fa-line-chart  text-blue"></i> 机加工时统计
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/est/query}" shiro:hasPermission="est:query:view" target="content">
                                <i class="fa fa-fax text-yellow"></i> 工艺卡查询
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/est/print}" shiro:hasPermission="est:print:view" target="content">
                                <i class="fa fa-print"></i> 工艺卡打印
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/est/change/query}" shiro:hasPermission="est:changequery:view" target="content">
                                <i class="fa fa-search text-yellow"></i> 工艺卡变更查询
                            </a>
                        </li>
                    </ul>
                </li>
                <!--物料信息输出管理-->
                <li shiro:hasPermission="malOut:menu" class="treeview">
                    <a href="#">
                        <i class="fa fa-folder-open   text-aqua"></i>
                        <span>物料信息输出管理</span>
                        <span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
                    </a>
                    <ul class="treeview-menu">
                        <li>
                            <a th:href="@{/report/add/out}" shiro:hasPermission="report:out:view" target="content">
                                <i class="fa fa-clone text-green"></i> 外购件提报
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/report/add/mal}" shiro:hasPermission="report:mal:view" target="content">
                                <i class="fa fa-file-text text-green"></i> 原材料提报
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/report/add/ass}" shiro:hasPermission="report:ass:view" target="content">
                                <i class="fa fa-window-restore text-green"></i> 外协件提报
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/report/list}" shiro:hasPermission="report:list:view" target="content">
                                <i class="fa fa-list text-green"></i> 提报计划提交
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/report/check}" shiro:hasPermission="report:check:view" target="content">
                                <i class="fa fa-check-circle-o text-green"></i> 提报计划审核
                                <span class="pull-right-container">
                                    <small class="label pull-right bg-yellow"
                                           th:text="${notCheckReportCount > 0 ? notCheckReportCount : ''}">12</small>
                                </span>
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/report/query}" shiro:hasPermission="report:query:view" target="content">
                                <i class="fa fa-search text-green"></i> 提报计划查询
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/report/query/detailList}" shiro:hasPermission="dsn:queryDetail:view" target="content">
                                <i class="fa fa-binoculars text-green"></i> 提报计划明细查询
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/production/add/make}" shiro:hasPermission="production:make:view"
                               target="content">
                                <i class="fa fa-object-ungroup     text-blue"></i> 创建制作件清单
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/production/list}" shiro:hasPermission="production:list:view"
                               target="content">
                                <i class="fa fa-list-ul text-blue"></i> 制作件清单提交
                                <span class="pull-right-container">
                                    <small id="notSubmitMakeCount" class="label pull-right bg-yellow"
                                           th:text="${notSubmitMakeCount > 0 ? notSubmitMakeCount : ''}">12</small>
                                </span>
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/production/check}" shiro:hasPermission="production:check:view"
                               target="content">
                                <i class="fa fa-check-circle text-blue"></i> 制作件清单审核
                                <span class="pull-right-container">
                                    <small id="notCheckMakeCount" class="label pull-right bg-red"
                                           th:text="${notCheckMakeCount > 0 ? notCheckMakeCount : ''}">12</small>
                                </span>
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/production/query}" shiro:hasPermission="production:query:view"
                               target="content">
                                <i class="fa fa-search text-blue"></i> 制作件清单查询
                            </a>
                        </li>
                    </ul>
                </li>
                <!--技术信息输出管理-->
                <li  class="treeview" >
                    <a href="#" shiro:hasPermission="tecOut:menu">
                        <i class="fa fa-folder-open   text-lime"></i>
                        <span>技术信息输出管理</span>
                        <span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
                    </a>
                    <ul class="treeview-menu">
                        <li>
                            <a th:href="@{/drawChange/add/modifyChange}" shiro:hasPermission="tec:drawing:view"
                               target="content">
                                <i class="fa fa-pencil-square text-teal"></i> 创建图纸变更单
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/drawChange/add/drawChangSubmitList}" shiro:hasPermission="tec:drasub:view"
                               target="content">
                                <i class="fa fa-paste text-teal"></i> 图纸变更单提交
                                <span class="pull-right-container">
                                    <small id="notSubmitDrawtCount" class="label pull-right bg-green"
                                           th:text="${notSubmitDrawtCount > 0 ? notSubmitDrawtCount : ''}">12</small>
                                </span>
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/drawChange/check}" shiro:hasPermission="tec:Drarev:view" target="content">
                                <i class="fa fa-check-square  text-teal"></i> 图纸变更单审核
                                <span class="pull-right-container">
                                    <small id="notCheckDrawCount" class="label pull-right bg-blue"
                                           th:text="${notCheckDrawCount > 0 ? notCheckDrawCount : ''}">12</small>
                                </span>
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/drawChange/query}" shiro:hasPermission="tec:Draquery:view" target="content">
                                <i class="fa fa-search text-teal"></i> 图纸变更单查询
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/drawLssue/select}" shiro:hasPermission="draw:lssue:view" target="content">
                                <i class="fa fa-file-text text-teal"></i> 图纸下发记录
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/drawRecord/select}" shiro:hasPermission="draw:changeRecord:view" target="content">
                                <i class="fa fa-check-square  text-teal"></i> 图纸变更记录
                            </a>
                        </li>
                        <li>
                           <a th:href="@{/map/doc}" shiro:hasPermission="doc:fileSearch:view" target="content">
                               <i class="fa fa-check-square  text-teal"></i> 图纸存档查询
                           </a>
                        </li>
                        <!--<li>-->
                            <!--<a th:href="@{/tecout/contact/createPage}" shiro:hasPermission="tec:Tecdes:view"-->
                               <!--target="content">-->
                                <!--<i class="fa fa-pencil-square-o  text-primary"></i> 创建技术联络单-->
                            <!--</a>-->
                        <!--</li>-->
                        <!--<li>-->
                            <!--<a th:href="@{/tecout/tecnote/subList}" shiro:hasPermission="tec:list:view"-->
                               <!--target="content">-->
                                <!--<i class="fa fa-table  text-primary"></i> 技术说明提交-->
                            <!--</a>-->
                        <!--</li>-->
                        <!--<li>-->
                            <!--<a th:href="@{/tecout/tecnote/checkList}" shiro:hasPermission="tec:check:view"-->
                               <!--target="content">-->
                                <!--<i class="fa fa-check-square-o  text-primary"></i> 技术说明审核-->
                            <!--</a>-->
                        <!--</li>-->
                        <!--<li>-->
                            <!--<a th:href="@{/tecout/tecnote/queryList}" shiro:hasPermission="tec:query:view"-->
                               <!--target="content">-->
                                <!--<i class="fa fa-search text-primary"></i> 技术说明查询-->
                            <!--</a>-->
                        <!--</li>-->
                    </ul>
                </li>
                <!--产品信息输出管理-->
                <li  class="treeview">
                    <a href="#"  shiro:hasPermission="productOut:menu">
                        <i class="fa fa-folder-open text-purple"></i>
                        <span>产品信息输出管理</span>
                        <span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
                    </a>
                    <ul class="treeview-menu">
                        <li>
                            <a th:href="@{/proout/coat/createPage}" shiro:hasPermission="tec:Painting:view" target="content">
                                <i class="fa fa-search-plus text-green"></i> 创建涂装设计清单
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/proout/coat/subList}" shiro:hasPermission="tec:submPaint:view" target="content">
                                <i class="fa fa-telegram text-green"></i> 涂装设计清单提交
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/proout/coat/checkList}" shiro:hasPermission="tec:auditCoat:view" target="content">
                                <i class="fa fa-get-pocket  text-green"></i> 涂装设计清单审核
                                <span class="pull-right-container">
                                    <small id="checkProOutCount" class="label pull-right bg-red"
                                           th:text="${checkProOutCount > 0 ? checkProOutCount : ''}">12</small>
                                </span>
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/proout/coat/queryList}" shiro:hasPermission="tec:quertPaint:view"  target="content">
                                <i class="fa fa-search  text-green"></i> 涂装设计清单查询
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/proout/coat/queryCheckList}" shiro:hasPermission="tec:quertPaint:checkQuery"  target="content">
                                <i class="fa fa-th-list  text-green"></i> 涂装设计清单查看
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/proout/instruct/instructPage}" shiro:hasPermission="tec:manual:view" target="content">
                                <i class="fa fa-microphone  text-blue"></i> 使用维护手册管理
                            </a>
                        </li>
                    </ul>
                </li>
                <!--成本信息输出管理-->
                <li  class="treeview">
                    <a href="#" shiro:hasPermission="cost:menu">
                        <i class="fa fa-folder-open   text-warning"></i>
                        <span>成本信息输出管理</span>
                        <span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
                    </a>
                    <ul class="treeview-menu">
                        <li class="treeview">
                            <a href="#" shiro:hasPermission="costDeshou:menu">
                                <i class="fa fa-folder-open   text-blue"></i>
                                <span>设计工时确认单</span>
                                <span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
                            </a>
                            <ul class="treeview-menu">
                                <li>
                                    <a th:href="@{/cost/dsnCost/create}" shiro:hasPermission="cost:Deshou:view" target="content">
                                        <i class="fa fa-microphone  text-blue"></i> 设计工时确认单录入
                                    </a>
                                </li>
                                <li>
                                    <a th:href="@{/cost/dsnCost/subList}" shiro:hasPermission="cost:DeshouConf:view" target="content">
                                        <i class="fa fa-bandcamp text-blue"></i> 设计工时确认单提交
                                    </a>
                                </li>
                                <li>
                                    <a th:href="@{/cost/dsnCost/checkList}" shiro:hasPermission="cost:Deshouexa:view" target="content">
                                        <i class="fa fa-check-circle  text-blue"></i> 设计工时确认单审核
                                    </a>
                                </li>
                            </ul>
                        </li>
                        <li class="treeview">
                            <a href="#" shiro:hasPermission="costBlank:menu">
                                <i class="fa fa-folder-open   text-blue"></i>
                                <span>下料工时计划单</span>
                                <span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
                            </a>
                            <ul class="treeview-menu">
                                <li>
                                    <a th:href="@{/craft/cost/blanking/create}" shiro:hasPermission="cost:Blank:view" target="content">
                                        <i class="fa fa-edit text-lime"></i> 下料工时计划单录入
                                    </a>
                                </li>
                                <li>
                                    <a th:href="@{/craft/cost/blanking/submit}" shiro:hasPermission="cost:BlankList:view" target="content">
                                        <i class="fa fa-superpowers  text-lime"></i> 下料工时计划单提交
                                    </a>
                                </li>
                                <li>
                                    <a th:href="@{/craft/cost/blanking/examine}" shiro:hasPermission="cost:Blanking:view" target="content">
                                        <i class="fa fa-check-square-o  text-lime"></i> 下料工时计划单审核
                                    </a>
                                </li>
                            </ul>
                        </li>
                        <li class="treeview">
                            <a href="#" shiro:hasPermission="costRivet:menu">
                                <i class="fa fa-folder-open   text-blue"></i>
                                <span>铆焊工时计划单</span>
                                <span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
                            </a>
                            <ul class="treeview-menu">
                                <li>
                                    <a th:href="@{/craft/cost/solder/create}" shiro:hasPermission="cost:rivet:view" target="content">
                                        <i class="fa fa-sign-in text-orange"></i> 铆焊工时计划单录入
                                    </a>
                                </li>
                                <li>
                                    <a th:href="@{/craft/cost/solder/submit}" shiro:hasPermission="cost:rivetTime:view" target="content">
                                        <i class="fa fa-telegram text-orange"></i> 铆焊工时计划单提交
                                    </a>
                                </li>
                                <li>
                                    <a th:href="@{/craft/cost/solder/examine}" shiro:hasPermission="cost:rivetList:view" target="content">
                                        <i class="fa fa-leaf  text-orange"></i> 铆焊工时计划单审核
                                    </a>
                                </li>
                            </ul>
                        </li>
                        <li class="treeview">
                            <a href="#" shiro:hasPermission="costHeat:menu">
                                <i class="fa fa-folder-open   text-blue"></i>
                                <span>热处理工时计划单</span>
                                <span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
                            </a>
                            <ul class="treeview-menu">
                                <li>
                                    <a th:href="@{/craft/cost/heat/create}" shiro:hasPermission="cost:heat:view" target="content">
                                        <i class="fa fa-paint-brush  text-maroon"></i> 热处理计划单录入
                                    </a>
                                </li>
                                <li>
                                    <a th:href="@{/craft/cost/heat/submit}" shiro:hasPermission="cost:heatment:commit" target="content">
                                        <i class="fa fa-external-link-square  text-maroon"></i> 热处理计划单提交
                                    </a>
                                </li>
                                <li>
                                    <a th:href="@{/craft/cost/heat/examine}" shiro:hasPermission="cost:heatList:view" target="content">
                                        <i class="fa fa-paper-plane-o  text-maroon"></i> 热处理计划单审核
                                    </a>
                                </li>
                            </ul>
                        </li>
                        <li class="treeview">
                            <a href="#" shiro:hasPermission="costAssemb:menu">
                                <i class="fa fa-folder-open   text-blue"></i>
                                <span>装配工时计划单</span>
                                <span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
                            </a>
                            <ul class="treeview-menu">
                                <li>
                                    <a th:href="@{/craft/cost/assembling/create}" shiro:hasPermission="cost:assemb:view" target="content">
                                        <i class="fa fa-pencil  text-success"></i> 装配工时计划单录入
                                    </a>
                                </li>
                                <li>
                                    <a th:href="@{/craft/cost/assembling/submit}" shiro:hasPermission="cost:assembing:view" target="content">
                                        <i class="fa fa-level-up text-success"></i> 装配工时计划单提交
                                    </a>
                                </li>
                                <li>
                                    <a th:href="@{/craft/cost/assembling/examine}" shiro:hasPermission="cost:assembList:view" target="content">
                                        <i class="fa fa-check-square text-success"></i> 装配工时计划单审核
                                    </a>
                                </li>
                            </ul>
                        </li>
                        <li class="treeview">
                            <a href="#" shiro:hasPermission="costPaint:menu">
                                <i class="fa fa-folder-open   text-blue"></i>
                                <span>涂装工时计划单</span>
                                <span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
                            </a>
                            <ul class="treeview-menu">
                                <li>
                                    <a th:href="@{/craft/cost/paint/create}" shiro:hasPermission="cost:Paint:view" target="content">
                                        <i class="fa fa-magic  text-aqua"></i> 涂装工时计划单录入
                                    </a>
                                </li>
                                <li>
                                    <a th:href="@{/craft/cost/paint/submit}" shiro:hasPermission="cost:Painting:view" target="content">
                                        <i class="fa fa-location-arrow  text-aqua"></i> 涂装工时计划单提交
                                    </a>
                                </li>
                                <li>
                                    <a th:href="@{/craft/cost/paint/examine}" shiro:hasPermission="cost:PaintList:view" target="content">
                                        <i class="fa fa-paper-plane  text-aqua"></i> 涂装工时计划单审核
                                    </a>
                                </li>
                            </ul>
                        </li>
                        <li class="treeview">
                            <a href="#" shiro:hasPermission="costPainting:menu">
                                <i class="fa fa-folder-open   text-blue"></i>
                                <span>安装工时计划单</span>
                                <span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
                            </a>
                            <ul class="treeview-menu">
                                <li>
                                    <a th:href="@{/craft/cost/install/create}" shiro:hasPermission="cost:install:view" target="content">
                                        <i class="fa fa-download  text-olive"></i> 安装工时计划单录入
                                    </a>
                                </li>
                                <li>
                                    <a th:href="@{/craft/cost/install/submit}" shiro:hasPermission="cost:instPlan:view" target="content">
                                        <i class="fa fa-upload text-olive"></i> 安装工时计划单提交
                                    </a>
                                </li>
                                <li>
                                    <a th:href="@{/craft/cost/install/examine}" shiro:hasPermission="cost:instalList:view" target="content">
                                        <i class="fa fa-check-circle text-olive"></i> 安装工时计划单审核
                                    </a>
                                </li>
                            </ul>
                        </li>
                        <li  class="treeview">
                            <a href="#" shiro:hasPermission="costDebug:menu">
                                <i class="fa fa-folder-open   text-blue"></i>
                                <span>调试工时确认单</span>
                                <span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
                            </a>
                            <ul class="treeview-menu">
                                <li>
                                    <a th:href="@{/cost/dsnDebug/create}" shiro:hasPermission="cost:debug:view" target="content">
                                        <i class="fa fa-video-camera   text-teal"></i>  调试工时确认单录入
                                    </a>
                                </li>
                                <li>
                                    <a th:href="@{/cost/dsnDebug/subList}" shiro:hasPermission="cost:debuggin:view" target="content">
                                        <i class="fa fa-exchange text-teal"></i>  调试工时确认单提交
                                    </a>
                                </li>
                                <li>
                                    <a th:href="@{/cost/dsnDebug/checkList}" shiro:hasPermission="cost:debugging:view" target="content">
                                        <i class="fa fa-edit text-teal"></i> 调试工时确认单审核
                                    </a>
                                </li>
                            </ul>
                        </li>
                        <li  class="treeview">
                            <a href="#" shiro:hasPermission="costMachining:menu">
                                <i class="fa fa-folder-open   text-blue"></i>
                                <span>机加工时计划单</span>
                                <span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
                            </a>
                            <ul class="treeview-menu">
                                <li>
                                    <a th:href="@{/craft/cost/machining/create}" shiro:hasPermission="cost:machining:view" target="content">
                                        <i class="fa fa-i-cursor  text-fuchsia"></i>  机加工时计划单录入
                                    </a>
                                </li>
                                <li>
                                    <a th:href="@{/craft/cost/machining/submit}" shiro:hasPermission="cost:machiningPlan:view" target="content">
                                        <i class="fa fa-cloud-upload text-fuchsia"></i>  机加工时计划单提交
                                    </a>
                                </li>
                                <li>
                                    <a th:href="@{/craft/cost/machining/examine}" shiro:hasPermission="cost:machiningList:view" target="content">
                                        <i class="fa fa-street-view  text-fuchsia"></i> 机加工时计划单审核
                                    </a>
                                </li>
                            </ul>
                        </li>
                        <li>
                            <a th:href="@{/craft/cost/query}" shiro:hasPermission="cost:Planquery:view" target="content">
                                <i class="fa fa-search  text-lime"></i> 成本信息输出查询
                            </a>
                        </li>
                    </ul>
                </li>
                <!--科技信息输出管理-->
                <li  class="treeview">
                    <a href="#" shiro:hasPermission="science:menu">
                        <i class="fa fa-folder-open   text-aqua"></i>
                        <span>科技信息输出管理</span>
                        <span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
                    </a>
                    <ul class="treeview-menu">
                        <li>
                            <a th:href="@{/invention}" shiro:hasPermission="sat:invention:view" target="content" >
                                <i class="fa fa-microphone  text-blue"></i>发明专利信息维护
                            </a>
                        </li>
                        <!--<li>-->
                            <!--<a shiro:hasPermission="sat:practical:view" target="content">-->
                                <!--<i class="fa fa-microphone  text-blue"></i> 实用新型维护-->
                            <!--</a>-->
                        <!--</li>-->
                        <!--<li>-->
                            <!--<a shiro:hasPermission="sat:Software:view" target="content">-->
                                <!--<i class="fa fa-microphone  text-blue"></i> 软件著作权维护-->
                            <!--</a>-->
                        <!--</li>-->
                    </ul>
                </li>
                <!--存档管理-->
                <li  class="treeview">
                    <a href="#" shiro:hasPermission="file:menu">
                        <i class="fa fa-folder-open   text-green "></i>
                        <span>存档清单管理</span>
                        <span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
                    </a>
                    <ul class="treeview-menu">
                        <li>
                            <a th:href="@{create/file/add}" shiro:hasPermission="file:found:view"  target="content">
                                <i class="fa fa-paste  text-red"></i> 创建存档清单
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/create/file/list}" shiro:hasPermission="file:submit:view" target="content">
                                <i class="fa fa-share-square-o  text-orange"></i> 存档清单提交
                                <span class="pull-right-container">
                                    <small id="notSubmitFileCount" class="label pull-right bg-red"
                                           th:text="${notSubmitFileCount > 0 ? notSubmitFileCount : ''}">12</small>
                                </span>
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/file/check}" shiro:hasPermission="file:check:view" target="content">
                                <i class="fa fa-list-ul  text-green"></i> 存档清单审核
                                <span class="pull-right-container">
                                    <small id="notCheckFileCount" class="label pull-right bg-orange"
                                           th:text="${notCheckFileCount > 0 ? notCheckFileCount : ''}">12</small>
                                </span>
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/file/confirm}" shiro:hasPermission="file:luess:view" target="content">
                                <i class="fa fa-list-ul  text-green"></i> 存档清单下发
                                <span class="pull-right-container">
                                    <small id="notLuessFileCount" class="label pull-right bg-green"
                                           th:text="${notLuessFileCount > 0 ? notLuessFileCount : ''}">12</small>
                                </span>
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/file/signFor}" shiro:hasPermission="file:sign:view" target="content">
                                <i class="fa fa-save  text-yellow"></i> 存档清单签收
                                <span class="pull-right-container">
                                    <small id="notSignFileCount" class="label pull-right bg-blue"
                                           th:text="${notSignFileCount > 0 ? notSignFileCount : ''}">12</small>
                                </span>
                            </a>
                        </li>
                        <li>
                            <a th:href="@{file/query}" shiro:hasPermission="file:query:view" target="content">
                                <i class="fa fa-search  text-blue"></i> 存档清单查询
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/file/confirm/end}" shiro:hasPermission="file:end:view" target="content">
                                <i class="fa fa-th" style="color:cyan"></i> 存档清单完结
                            </a>
                        </li>
                    </ul>
                </li>

                <li class="treeview" shiro:hasPermission="lia:menu">
                    <a href="#">
                        <i class="fa fa-folder-open text-maroon"></i>
                        <span>项目联络单管理</span><span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
                    </a>
                    <ul class="treeview-menu">
                        <li class="active"><a th:href="@{/contact/create}" shiro:hasPermission="lia:set:view" target="content"><i class="fa fa-refresh text-maroon"></i> 创建项目联络单</a>
                        </li>
                        <li class="active"><a th:href="@{/contact/return}" shiro:hasPermission="lia:reply:view"  target="content"><i class="fa fa-comments-o text-maroon"></i> 项目联络单回复</a>
                        </li>
                        <li class="active"><a th:href="@{/contact/examine}" shiro:hasPermission="lia:alter:view" target="content"><i class="fa fa-check-circle-o text-maroon"></i> 项目联络单审核</a>
                        </li>
                        <li class="active"><a th:href="@{/contact/select}" shiro:hasPermission="lia:liaison:view" target="content"><i class="fa fa-search text-maroon"></i> 项目联络单查询</a>
                        </li>
                    </ul>
                </li>

                <!--基础信息配置-->
                <li shiro:hasPermission="basic:menu" class="treeview">
                    <a href="#">
                        <i class="fa fa-folder-open text-orange"></i>
                        <span>基础信息配置</span>
                        <span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
                    </a>
                    <ul class="treeview-menu">
                        <li>
                            <a th:href="@{/sys/dept}" shiro:hasPermission="system:dept:view" target="content">
                                <i class="fa fa-users text-teal"></i> 部门管理
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/basic/dict}" shiro:hasPermission="basic:dict:view" target="content">
                                <i class="fa fa-book text-bold"></i> 数据字典
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/basic/verify}" shiro:hasPermission="basic:verify:view" target="content">
                                <i class="fa fa-check-square text-yellow"></i> 审核配置
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/craft/dict/process/}" shiro:hasPermission="com:procedure:view" target="content">
                                <i class="fa fa-magnet text-blue"></i> 工序配置
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/basic/org}" shiro:hasPermission="basic:org:view" target="content">
                                <i class="fa fa-users text-red"></i> 审核组织架构
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/craft/dict/equ/}" shiro:hasPermission="com:equipment:view" target="content">
                                <i class="fa fa-deviantart text-orange"></i> 设备名称配置
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/craft/dict/route}" shiro:hasPermission="com:rote:view" target="content">
                                <i class="fa fa-subway text-red"></i> 工艺路线配置
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/craft/dict/person}" shiro:hasPermission="com:process:view" target="content">
                                <i class="fa fa-user-secret text-green"></i> 工艺审核人配置
                            </a>
                        </li>
                    </ul>
                </li>
                <!--系统管理-->
                <li shiro:hasPermission="system:menu" class="treeview">
                    <a href="#">
                        <i class="fa fa-folder-open text-orange"></i>
                        <span>系统管理</span><span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
                    </a>
                    <ul class="treeview-menu">
                        <li>
                            <a th:href="@{/sys/user}" shiro:hasPermission="system:user:view" target="content">
                                <i class="fa fa-user-md text-teal"></i> 帐号管理
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/sys/role}" shiro:hasPermission="system:role:view" target="content">
                                <i class="fa fa-user-secret text-yellow"></i> 角色管理
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/sys/menu}" shiro:hasPermission="system:permission:view" target="content">
                                <i class="fa  fa-user-times text-blue"></i> 权限管理
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/sys/log}" shiro:hasPermission="system:log:view" target="content">
                                <i class="fa fa-file-text-o text-green"></i> 操作日志
                            </a>
                        </li>
                    </ul>
                </li>
            </ul>
        </section>
    </aside>

    <div class="content-wrapper">
        <iframe id="content" th:src="@{/overview/home/}" scrolling="auto" frameborder="0" name="content" width="100%"
                height="100%"></iframe>
    </div>
</div>

<div th:include="include :: footer"></div>
<script th:inline="javascript">
    /** 获取当前登录用户名 */
    function getUserName() {
        $.post(ctx + 'getLoginUserName',
            {},
            function (result) {
                $("#user_name").html(result.data);
            }, 'json')
    }

    /** 如果首页不在最顶层， 将最顶层改为首页 */
    if (window.parent.window !== window) {
        window.top.location = ctx;
    }

    /** 修改iframe框架高度 */
    function changeFrameHeight() {
        var ifm = document.getElementById("content");
        ifm.height = document.documentElement.clientHeight - 56;
    }

    /** 窗口大小改变事件 */
    window.onresize = function () {
        changeFrameHeight();
    };

    // /** 获取下任务消息 */
    // function getSend() {
    //     $("#unread-send").html('');
    //     $("#count-send").html('');
    //     $("#no-send").show();
    //     js.get({
    //         url: ctx + "send",
    //         success: function (result) {
    //             if (result.length > 0) {
    //                 $("#no-send").hide();
    //                 $("#count-send").html(result.length);
    //                 result.forEach(function (v, i, array) {
    //                     let img = ctx + "img/avatar.png";
    //                     $("#unread-send").append(`
    //                         <li><a class="message-send" target="_blank" href="${ctx + 'board/single/' + v.projectId + '/' + v.id}">
    //                         <div class="pull-left"> <img class="img-circle" alt="Image" src="${img}"></div>
    //                         <h4>系统通知<small><i class="fa fa-clock-o"></i>${v.createTime}</small></h4>
    //                         <p>${v.content}</p></a></li>
    //                     `);
    //                 })
    //             }
    //             js.modal.closeLoading();
    //
    //         }
    //     });
    // }
    //
    // /** 获取下任务消息 */
    // function getChange() {
    //     $("#unread-change").html('');
    //     $("#count-change").html('');
    //     $("#no-change").show();
    //     js.get({
    //         url: ctx + "change",
    //         success: function (result) {
    //             if (result.length > 0) {
    //                 $("#no-change").hide();
    //                 $("#count-change").html(result.length);
    //                 result.forEach(function (v, i, array) {
    //                     let img = ctx + "img/avatar.png";
    //                     $("#unread-change").append(`
    //                         <li><a class="message-change" target="_blank" href="${ctx + 'board/single/' + v.projectId + '/' + v.id}">
    //                         <div class="pull-left"> <img class="img-circle" alt="Image" src="${img}"></div>
    //                         <h4>系统通知<small><i class="fa fa-clock-o"></i>${v.createTime}</small></h4>
    //                         <p>${v.content}</p></a></li>
    //                     `);
    //                 })
    //             }
    //             js.modal.closeLoading();
    //
    //         }
    //     });
    // }

    // /**
    //  * 获取互动消息
    //  */
    // function getInteractive() {
    //     $("#unread-interactive").html('');
    //     $("#count-interactive").html('');
    //     $("#no-interactive").show();
    //     js.get({
    //         url: ctx + "receiver",
    //         success: function (result) {
    //             if (result.length > 0) {
    //                 $("#no-interactive").hide();
    //                 $("#count-interactive").html(result.length);
    //                 result.forEach(function (v, i, array) {
    //                     let img = v.sendUserImage == null ? (ctx + "img/avatar.png") : v.sendUserImage;
    //                     $("#unread-interactive").append(`
    //                         <li><a class="message-interactive" target="_blank" href="${ctx + 'board/single/' + v.projectId + '/' + v.id}">
    //                         <div class="pull-left"> <img class="img-circle" alt="Image" src="${img}"></div>
    //                         <h4>${v.sendUserName}<small><i class="fa fa-clock-o"></i>${v.createTime}</small></h4>
    //                         <p>${v.content}</p></a></li>
    //                     `);
    //                 })
    //             }
    //             js.modal.closeLoading();
    //
    //         }
    //     });
    // }

    // /**控制菜单显示*/
    // function roleControllerMenu() {
    //     var roles = [[${roleCodes}]];
    //     $("#W01").hide();
    //     $("#W02").hide();
    //     $("#W03").hide();
    //     var wcount=0;
    //     for (var i = 0; i < roles.length; i++) {
    //         if (roles[i] == "W01") {
    //             $("#W01").show();
    //             wcount++;
    //         }else
    //         if (roles[i] == "W02") {
    //             $("#W02").show();
    //             wcount++;
    //         }else
    //         if (roles[i] == "W03") {
    //             $("#W03").show();
    //             wcount++;
    //         }
    //     }
    //     if(wcount==0){
    //         $("#W01").show();
    //         $("#W02").show();
    //         $("#W03").show();
    //     }
    //
    //
    // }

    $(function () {

        /** iframe 自动高度 */
        changeFrameHeight();

        /** 验证初始化 */
        js.validate.init("userForm", {
            fields: {
                pwd: {validators: {notEmpty: {message: '请输入密码'}}},
                rePwd: {
                    validators: {
                        notEmpty: {message: '请确认密码'},
                        identical: {field: 'pwd', message: '两次密码不一致'}
                    }
                }
            }
        });

        /** 修改密码 */
        $("#btn-updatePassword").click(function () {
            if (js.validate.isValid("userForm")) {
                js.post({
                    url: ctx + "update/user/pwd",
                    data: $("#userForm").serialize(),
                    success: function (result) {
                        if (result.type === web_status.SUCCESS) {
                            js.modal.success(result.msg);
                            js.modal.hide("modal-updatePassword");
                        } else {
                            js.modal.warning(result.msg);
                        }
                    }
                });
            }
        });


        /** 菜单栏点击事件 */
        $(".treeview-menu>li").click(function () {
            $(".treeview-menu>li").removeClass("active");
            $(this).addClass("active");
        });

        // /** 初始化WebSocket */
        // js.ws.init({
        //     // url: "ws://192.168.72.158:8080/websocket",
        //     url: "ws://192.168.50.3:8081/websocket",
        //     handler: function (msg) {
        //         if (msg.data === "INTERACTIVE") {
        //             getInteractive();
        //         } else if (msg.data === "SEND") {
        //             getSend();
        //         } else if (msg.data === "CHANGE") {
        //             getChange();
        //         }
        //     }
        // });

        /** 获取互动消息 */
        // getInteractive();

        /** 获取下任务消息 */
        // getSend();

        /** 获取项目变更消息 */
        // getChange();

        // /** 互动消息点击 */
        // $(document).on('click', ".message-interactive", function () {
        //     var count = parseInt($("#count-interactive").text());
        //     if (count > 1) {
        //         $("#count-interactive").text(count - 1);
        //     } else {
        //         $("#count-interactive").text('');
        //     }
        //     $(this).parent().remove();
        // });

        // /** 下任务点击 */
        // $(document).on('click', ".message-send", function () {
        //     var count = parseInt($("#count-send").text());
        //     if (count > 1) {
        //         $("#count-send").text(count - 1);
        //     } else {
        //         $("#count-send").text('');
        //     }
        //     $(this).parent().remove();
        // });
        //
        // /** 下任务点击 */
        // $(document).on('click', ".message-change", function () {
        //     var count = parseInt($("#count-change").text());
        //     if (count > 1) {
        //         $("#count-change").text(count - 1);
        //     } else {
        //         $("#count-change").text('');
        //     }
        //     $(this).parent().remove();
        // });


        initCropperInModal($('#photo'), $('#photoInput'), $('#modal-upload'));
        initCropperInModalSign($('#signImg'), $('#signInput'), $('#modal-sign'));


    });

    var initCropperInModal = function (img, input, modal) {
        var $image = img;
        var $inputImage = input;
        var $modal = modal;
        var options = {
            aspectRatio: 1, // 纵横比
            viewMode: 2,
            preview: '.img-preview' // 预览图的class名
        };
        // 模态框隐藏后需要保存的数据对象
        var saveData = {};
        var URL = window.URL || window.webkitURL;
        var blobURL;
        $modal.on('show.bs.modal', function () {
            // 如果打开模态框时没有选择文件就点击“打开图片”按钮
            if (!$inputImage.val()) {
                $inputImage.click();
            }
        }).on('shown.bs.modal', function () {
            // 重新创建
            $image.cropper($.extend(options, {
                ready: function () {
                    // 当剪切界面就绪后，恢复数据
                    if (saveData.canvasData) {
                        $image.cropper('setCanvasData', saveData.canvasData);
                        $image.cropper('setCropBoxData', saveData.cropBoxData);
                    }
                }
            }));
        }).on('hidden.bs.modal', function () {
            // 保存相关数据
            saveData.cropBoxData = $image.cropper('getCropBoxData');
            saveData.canvasData = $image.cropper('getCanvasData');
            // 销毁并将图片保存在img标签
            $image.cropper('destroy').attr('src', blobURL);
        });
        if (URL) {
            $inputImage.change(function () {
                var files = this.files;
                var file;
                if (!$image.data('cropper')) {
                    return;
                }
                if (files && files.length) {
                    file = files[0];
                    if (/^image\/\w+$/.test(file.type)) {

                        if (blobURL) {
                            URL.revokeObjectURL(blobURL);
                        }
                        blobURL = URL.createObjectURL(file);

                        // 重置cropper，将图像替换
                        $image.cropper('reset').cropper('replace', blobURL);

                        // 选择文件后，显示和隐藏相关内容
                        $('.img-container').removeClass('hidden');
                        $('.img-preview-box').removeClass('hidden');
                        $('#btn-upload').removeAttr('disabled').removeClass('disabled');
                        $('.tip-info').addClass('hidden');

                    } else {
                        window.alert('请选择一个图像文件！');
                    }
                }
            });
        } else {
            $inputImage.prop('disabled', true).addClass('disabled');
        }
    }

    var initCropperInModalSign = function (img, input, modal) {
        var $image = img;
        var $inputImage = input;
        var $modal = modal;
        var options = {
            aspectRatio: 3 / 1, // 纵横比
            viewMode: 2/*,
    preview: '.img-preview' // 预览图的class名*/
        };
        // 模态框隐藏后需要保存的数据对象
        var saveData = {};
        var URL = window.URL || window.webkitURL;
        var blobURL;
        $modal.on('show.bs.modal', function () {
            // 如果打开模态框时没有选择文件就点击“打开图片”按钮
            if (!$inputImage.val()) {
                $inputImage.click();
            }
        }).on('shown.bs.modal', function () {
            // 重新创建
            $image.cropper($.extend(options, {
                ready: function () {
                    // 当剪切界面就绪后，恢复数据
                    if (saveData.canvasData) {
                        $image.cropper('setCanvasData', saveData.canvasData);
                        $image.cropper('setCropBoxData', saveData.cropBoxData);
                    }
                }
            }));
        }).on('hidden.bs.modal', function () {
            // 保存相关数据
            saveData.cropBoxData = $image.cropper('getCropBoxData');
            saveData.canvasData = $image.cropper('getCanvasData');
            // 销毁并将图片保存在img标签
            $image.cropper('destroy').attr('src', blobURL);
        });
        if (URL) {
            $inputImage.change(function () {
                var files = this.files;
                var file;
                if (!$image.data('cropper')) {
                    return;
                }
                if (files && files.length) {
                    file = files[0];
                    if (/^image\/\w+$/.test(file.type)) {

                        if (blobURL) {
                            URL.revokeObjectURL(blobURL);
                        }
                        blobURL = URL.createObjectURL(file);

                        // 重置cropper，将图像替换
                        $image.cropper('reset').cropper('replace', blobURL);

                        // 选择文件后，显示和隐藏相关内容
                        $('.sign-img-container').removeClass('hidden');
                        // $('.img-preview-box').removeClass('hidden');
                        $('#btn-sign').removeAttr('disabled').removeClass('disabled');
                        $('.sign-tip-info').addClass('hidden');

                    } else {
                        window.alert('请选择一个图像文件！');
                    }
                }
            });
        } else {
            $inputImage.prop('disabled', true).addClass('disabled');
        }
    }
    /**上传头像*/
    var sendPhoto = function () {
        var photo = $('#photo').cropper('getCroppedCanvas', {
            width: 300,
            height: 300
        }).toDataURL('image/png');

        $.post(ctx + "sys/user/edit/img", {imageData: photo}, function (result) {
            $('#userImage').attr('src', result.data);
            js.modal.hide("modal-upload");
        });
    }


</script>
</body>
</html>
